Skip to content

Remove key_t #12246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed

Remove key_t #12246

wants to merge 6 commits into from

Conversation

rolandschulz
Copy link
Contributor

@rolandschulz rolandschulz commented Dec 25, 2023

Unnecessary. Simplifies defining properties.
Part 2 of simplifying properties.

They had the unnecessary difference that for runtime the key was an alias.

Advantage of unifying:
- Usage is the unified (e.g. get_property always needs the key).
- Simplifies implementation (future PR) which improves compilation speed
Unnecessary. Simplifies defining properties.
@rolandschulz rolandschulz requested review from a team as code owners December 25, 2023 22:13
@rolandschulz rolandschulz marked this pull request as draft December 25, 2023 22:13
@rolandschulz
Copy link
Contributor Author

Draft because part 1 (#12245) should be merged first. Otherwise ready for review. Only review extra commits beyond part 1.

Copy link
Contributor

github-actions bot commented Dec 25, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

template<typename V, typename O> struct is_property_value_of<V, O, std::void_t<typename V::key_t>> :
is_property_key_of<typename V::key_t, O> {};
template<typename V> struct is_property_value<V, std::void_t<key_from_value<V>>> : //key_from_value is exposition only
is_property_key<key_from_value<V>> {};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is is_property_key actual useful? This could instead just check that it is of type property_value<T...>. And if we remove is_property_key properties don't need to set that trait. And I'm only aware of useful usage of is_property_key_of. Why would a user care whether something is a property key rather than only whether it is a valid property for a certain usage?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the constraint for properties::has_property and properties::get_property requires us to know whether a type is a property key. How do we do that without the is_property_key trait?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right the trait is useful for that and in that case we might as well expose it in case a user has some use for it. And we can still remove the need for the each property to set the trait in the implementation. We can instead e.g. check PropertyToKind.

@maarquitos14
Copy link
Contributor

@rolandschulz I forgot to set myself busy in GH, but I'll be off until Jan 3rd. If a review is required before that, please, ask someone else from runtime reviewers.

Copy link
Contributor

@v-klochkov v-klochkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in ESIMD look good.

@maarquitos14
Copy link
Contributor

@rolandschulz I have seen in #12245 that we are not sure if this change should go forward, or at least that's my understanding. Should I review this PR or it's better to wait until it's clear we want to go forward with this change?

@rolandschulz
Copy link
Contributor Author

@rolandschulz I have seen in #12245 that we are not sure if this change should go forward, or at least that's my understanding. Should I review this PR or it's better to wait until it's clear we want to go forward with this change?

Feel free to wait until #12245 is resolved.

@rolandschulz
Copy link
Contributor Author

Part of #13669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants